package com.xzy.shop.web.servlet;

import com.xzy.shop.domain.Photo;
import com.xzy.shop.service.PhotoService;
import com.xzy.shop.service.impl.PhotoServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/photo/*")
public class PhotoServlet extends BaseServlet {
    PhotoService service = new PhotoServiceImpl();
    public void findPicByGid(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String gid = request.getParameter("gid");
        List<Photo> list = service.findByGid(gid);
        writeValue(list, response);
    }

    public void findinfoByGid(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String gid = request.getParameter("gid");
        List<Photo> list = service.findinfoByGid(gid);
        writeValue(list, response);
    }
}
